home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / lib / cave.g < prev    next >
Text File  |  1995-05-04  |  4KB  |  203 lines

  1. (game-module "cave"
  2.   (title "Cave")
  3.   (blurb "Explore the Cave of Wandering Death")
  4. )
  5.  
  6. (terrain-type floor (color "light gray") (image-name "floor") (char "."))
  7. (terrain-type passage (color "gray") (image-name "flagstone") (char "."))
  8. (terrain-type rock (color "dim gray") (image-name "rock") (char "#"))
  9.  
  10. (add rock thickness 10)
  11.  
  12. (unit-type human (image-name "person") (char "@")
  13.   (hp-max 10) (acp-per-turn 4))
  14.  
  15. (unit-type orc
  16.   (hp-max 10) (acp-per-turn 4))
  17. (unit-type elf
  18.   (hp-max 10) (acp-per-turn 4))
  19. (unit-type dwarf
  20.   (hp-max 10) (acp-per-turn 4))
  21.  
  22. (unit-type giant-ant (image-name "ant")
  23.   (hp-max 15) (acp-per-turn 4))
  24. (unit-type giant-beetle (image-name "beetle")
  25.   (hp-max 20) (acp-per-turn 4))
  26. (unit-type giant-spider (image-name "spider")
  27.   (hp-max 25) (acp-per-turn 4))
  28.  
  29. (unit-type white-dragon (image-name "dragon")
  30.   (hp-max 40) (acp-per-turn 4))
  31. (unit-type red-dragon (image-name "red-dragon")
  32.   (hp-max 50) (acp-per-turn 4))
  33.  
  34. (unit-type imp (image-name "person")
  35.   (hp-max 5) (acp-per-turn 4))
  36. (unit-type pit-demon
  37.   (hp-max 50) (acp-per-turn 4))
  38.  
  39. (unit-type sapphire (name "huge sapphire") (image-name "gem") (char "*"))
  40. (unit-type ruby (name "huge ruby") (image-name "gem") (char "*"))
  41. (unit-type diamond (name "huge diamond") (image-name "gem") (char "*"))
  42.  
  43. (define humanoids (orc elf dwarf))
  44.  
  45. (define insects (giant-ant giant-beetle giant-spider))
  46.  
  47. (define dragons (white-dragon red-dragon))
  48.  
  49. (define reptiles (white-dragon red-dragon))
  50.  
  51. (define demons (imp pit-demon))
  52.  
  53. (define monsters (append humanoids insects reptiles demons))
  54.  
  55. (define animate (append human monsters))
  56.  
  57. (define items (sapphire ruby diamond))
  58.  
  59. (material-type food)
  60. (material-type water)
  61. (material-type gold)
  62.  
  63. ;;; Static relationships.
  64.  
  65. (include "ng-weird")
  66.  
  67. (add human namer "generic-names")
  68.  
  69. (add human possible-sides "human")
  70.  
  71. (add monsters possible-sides "monster")
  72.  
  73. (table unit-storage-x
  74.   (human m* (200 50 0))
  75.   )
  76.  
  77. (add human capacity 100)
  78. (add humanoids capacity 100)
  79. (add dragons capacity 200)
  80.  
  81. (table unit-size-as-occupant
  82.   (u* u* 999)
  83.   (items u* 1)
  84.   )
  85.  
  86. (add t* capacity (16 4 0))
  87.  
  88. (table unit-size-in-terrain
  89.   (animate t* 4)
  90.   (items t* 1)
  91.   )
  92.  
  93. ;;; Vision.
  94.  
  95. ;; (should make longer only around light sources or some such)
  96.  
  97. (add u* vision-range 5)
  98. ;; Humans are not cave dwellers by nature, don't see as well.
  99. (add human vision-range 4)
  100.  
  101. (add u* vision-bend 0)
  102.  
  103. (table eye-height
  104.   (u* t* 5)
  105.   )
  106.  
  107. ;;; Action parameters.
  108.  
  109. (add items acp-per-turn 0)
  110.  
  111. ;;; Movement parameters.
  112.  
  113. (table mp-to-enter-terrain
  114.   (u* rock 99)
  115.   )
  116.  
  117. ;;; Combat parameters.
  118.  
  119. (table hit-chance
  120.   (u* u* 50)
  121.   )
  122.  
  123. (table damage
  124.   (u* u* 1d6)
  125.   )
  126.  
  127. (table acp-to-capture
  128.   (u* items 1)
  129.   )
  130.  
  131. (table independent-capture-chance
  132.   (u* items 100)
  133.   )
  134.  
  135. ;; Dwarves can dig.
  136.  
  137. (table acp-to-add-terrain
  138.   (dwarf (floor passage) 1)
  139.   )
  140.  
  141. (table acp-to-remove-terrain
  142.   (dwarf rock 1)
  143.   )
  144.  
  145. ;;; Backdrop activities.
  146.  
  147. (add u* hp-recovery 100)
  148.  
  149. ;;; Random setup.
  150.  
  151. (add floor maze-room-occurrence 1)
  152.  
  153. (add passage maze-passage-occurrence 1)
  154.  
  155. (add t* occurrence 0)
  156.  
  157. (add rock occurrence 1)
  158.  
  159. (set edge-terrain rock)
  160.  
  161. ;;; One adventurer on a side.
  162.  
  163. (add human start-with 1)
  164.  
  165. (add monsters start-with 1)
  166. ;(add insects start-with 2)
  167. ;(add humanoids start-with 3)
  168.  
  169. (set country-radius-min 4)
  170. (set country-separation-min 15)
  171. (set country-separation-max 20)
  172.  
  173. (table independent-density
  174.   (items floor 1000)
  175.   )
  176.  
  177. (table favored-terrain
  178.   (u* floor 100)
  179.   (u* rock 0)
  180.   )
  181.  
  182. (set synthesis-methods
  183.   '(make-maze-terrain make-countries make-independent-units))
  184.  
  185. (set sides-min 2)
  186.  
  187. (side 1 (name "You") (class "human") (emblem-name "none")
  188.   (self-unit 1))
  189.  
  190. ;(unit 0 human (s 1))
  191.  
  192. (side 2 (noun "Monster") (class "monster") (emblem-name "none"))
  193.  
  194. (scorekeeper (do last-side-wins))
  195.  
  196. (game-module (notes (
  197.   "Cave exploration, with monsters."
  198.   )))
  199.  
  200. (game-module (design-notes (
  201.   "This is a pretty basic game.  It could be much elaborated."
  202.   )))
  203.